﻿using System;
using UnityEngine;

namespace Studio
{
	// Token: 0x02000485 RID: 1157
	public static class TreeNodeCommand
	{
		// Token: 0x02000486 RID: 1158
		public class MoveCopyInfo
		{
			// Token: 0x06001C79 RID: 7289 RVA: 0x000B73D8 File Offset: 0x000B55D8
			public MoveCopyInfo(int _dicKey, ChangeAmount _old, ChangeAmount _new)
			{
				this.dicKey = _dicKey;
				this.oldValue = new Vector3[]
				{
					_old.pos,
					_old.rot
				};
				this.newValue = new Vector3[]
				{
					_new.pos,
					_new.rot
				};
			}

			// Token: 0x04001F7B RID: 8059
			public int dicKey;

			// Token: 0x04001F7C RID: 8060
			public Vector3[] oldValue = new Vector3[]
			{
				Vector3.zero,
				Vector3.zero
			};

			// Token: 0x04001F7D RID: 8061
			public Vector3[] newValue = new Vector3[]
			{
				Vector3.zero,
				Vector3.zero
			};
		}

		// Token: 0x02000487 RID: 1159
		public class MoveCopyCommand : ICommand
		{
			// Token: 0x06001C7A RID: 7290 RVA: 0x000B74B0 File Offset: 0x000B56B0
			public MoveCopyCommand(TreeNodeCommand.MoveCopyInfo[] _changeAmountInfo)
			{
				this.changeAmountInfo = _changeAmountInfo;
			}

			// Token: 0x06001C7B RID: 7291 RVA: 0x000B74C0 File Offset: 0x000B56C0
			public void Do()
			{
				for (int i = 0; i < this.changeAmountInfo.Length; i++)
				{
					ChangeAmount changeAmount = Studio.GetChangeAmount(this.changeAmountInfo[i].dicKey);
					if (changeAmount != null)
					{
						changeAmount.pos = this.changeAmountInfo[i].newValue[0];
						changeAmount.rot = this.changeAmountInfo[i].newValue[1];
					}
				}
			}

			// Token: 0x06001C7C RID: 7292 RVA: 0x000B7540 File Offset: 0x000B5740
			public void Redo()
			{
				this.Do();
			}

			// Token: 0x06001C7D RID: 7293 RVA: 0x000B7548 File Offset: 0x000B5748
			public void Undo()
			{
				for (int i = 0; i < this.changeAmountInfo.Length; i++)
				{
					ChangeAmount changeAmount = Studio.GetChangeAmount(this.changeAmountInfo[i].dicKey);
					if (changeAmount != null)
					{
						changeAmount.pos = this.changeAmountInfo[i].oldValue[0];
						changeAmount.rot = this.changeAmountInfo[i].oldValue[1];
					}
				}
			}

			// Token: 0x04001F7E RID: 8062
			private TreeNodeCommand.MoveCopyInfo[] changeAmountInfo;
		}
	}
}
